package com.big.app.controller;

import com.big.app.entity.PhotoArticle;
import com.big.app.service.intf.PhotoArticleService;
import com.big.app.vo1.R;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController //@Controller+@ResponseBody
@RequestMapping("/api/article/") //映射地址
@CrossOrigin //跨域
@Api(value = "实现拍照相关操作",tags = "实现拍照相关操作")
public class PhotoArticleController {
    @Resource
    private PhotoArticleService service;

    @GetMapping("query.do")
    public R query(){
        return service.queryTop();
    }

    @PostMapping("save.do")
    public R save(@RequestBody PhotoArticle article){
        return service.add(article);
    }

    @GetMapping("detail.do")
    public R queryDetail(int id){
        return service.queryDetail(id);
    }
}
